package com.liuya.safe.client.service;

import com.liuya.common.exception.EntityExistException;
import com.liuya.safe.client.pojo.Application;
import com.liuya.safe.client.pojo.UserType;

import java.util.Collection;
import java.util.Locale;

/**
 * @author liuya
 * @date 20161014
 */

public interface ApplicationManager {

    public void addApplication(Locale locale, Application app) throws EntityExistException;

    public void updateApplication(Application app);

    public void deleteApplication(String name);

    public Application getApplication(String name);

    public Collection getAllApplications();

    public void addAppUserType(Locale locale, String appName, UserType userType);

    /**
     * Update an ${@link UserType} of an application, update by usertype's name.
     *
     * @param appName
     * @param userType
     */
    public void updateApplicatonUserType(String appName, UserType userType);

    /**
     * Delete an ${@link UserType} from an application, it will delete some
     * related tables
     *
     * @param appName
     * @param userTypeName
     */
    public void deleteAppUserType(String appName, String userTypeName);
}
